﻿<UserControl x:Class="SourceControlMonitor.Views.NotifyToolTip"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:tb="http://www.hardcodet.net/taskbar"
             mc:Ignorable="d"
             x:Name="me"
             Width="355"
             Background="Transparent"
             Height="136">
    <UserControl.Resources>
        <Storyboard x:Key="FadeIn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.46,0.969"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="FadeOut">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.25"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.6"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipOpened">
            <BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipClose">
            <BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/>
        </EventTrigger>
    </UserControl.Triggers>
    <Border Grid.ColumnSpan="2" Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" CornerRadius="6,6,6,6" BorderThickness="3,3,3,3" x:Name="border">
        <Grid x:Name="LayoutRoot" Background="Transparent" Opacity="0.85">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image HorizontalAlignment="Left" Width="36" Source="../Resources/SourceControlMonitor.ico" Stretch="Uniform" VerticalAlignment="Top" RenderTransformOrigin="0.792,0.486" x:Name="image" >
                <Image.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform AngleX="0" AngleY="0"/>
                        <RotateTransform Angle="0"/>
                        <TranslateTransform X="0" Y="0"/>
                    </TransformGroup>
                </Image.RenderTransform>
            </Image>
            <TextBlock Margin="10" TextWrapping="Wrap" Grid.Column="1" Height="32" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Foreground="#FF575757" Text="MVVM Source Control Monitor" />
            <TextBlock Margin="0,0,0,15" Grid.ColumnSpan="2" Grid.Row="2" FontSize="12" FontWeight="Bold" Foreground="#FF141414" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="txtToolTipDetail" d:LayoutOverrides="Height">
                <Run>Double-click on tray icon => Show main window</Run><LineBreak/>
                <Run>Right-click on balloon => Dismiss</Run><LineBreak/>
                <Run>Left-click on balloon => Dismiss and show main window</Run>
            </TextBlock>
        </Grid>
    </Border>
</UserControl>
